﻿using System;

namespace Simp.Model
{
	/// <summary>Specifies the name of an expression.</summary>
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
	public class ExpressionNameAttribute : Attribute
	{
		private readonly string _name;

		/// <summary>Constructor taking the name of the expression as parameter.</summary>
		/// <param name="name"></param>
		public ExpressionNameAttribute(string name)
		{
			if (string.IsNullOrEmpty(name))
			{
				throw new ArgumentNullException("name");
			}
			_name = name;
		}

		/// <summary>Returns the name of the expression.</summary>
		public string Name
		{
			get { return _name; }
		}
	}
}